#pragma once
#include "DGeometry.h"

namespace Skill
{
	namespace Ode
	{
		ref class DMatrix4;
		ref class DVector3;
		ref class DVector4;
		ref class DSpace;

		namespace Geometries
		{			
			public ref class DPlane : DGeometry
			{
			protected:
				virtual void CollectManagedMemory() override;
			public:
				DPlane(DSpace^ space, dReal a, dReal b, dReal c, dReal d);
				DPlane(DSpace^ space, DVector3^ normal , dReal d);

				REF_PROP_DECLARATION_GETSET(DVector4,Normal);
				VALUE_PROP_DECLARATION_GETSET(dReal,D);

				void SetParams(dReal a, dReal b, dReal c, dReal d);
				void SetParams(DVector3^ normal, dReal d);
				void SetParams(DVector4^ normalAndD);

				///<summary>
				/// Return the depth of a point in a plane.
				///</summary>
				///<param name = "x"> The X coordinate of the point to test.</param>
				///<param name = "y"> The Y coordinate of the point to test.</param>
				///<param name = "z"> The Z coordinate of the point to test.</param>
				dReal PointDepth(dReal x, dReal y, dReal z);
				///<summary>
				/// Return the depth of a point in a plane.
				///</summary>
				///<param name = "p"> Coordinate of the point to test.</param>								
				dReal PointDepth(DVector3^ p);
			};
		}
	}
}